var e = require("../../../../../@babel/runtime/helpers/slicedToArray"),
  t = require("../../../../../@babel/runtime/helpers/objectSpread2");
Component({
  properties: {
    content: {
      type: Object,
      value: {}
    }
  },
  data: {
    markers: [{
      iconPath: "https://statics.zhaogongdi.com/images/wp/location.png",
      latitude: "",
      longitude: "",
      id: 1,
      width: 40,
      height: 40
    }]
  },
  methods: {
    onCall: function () {
      $.getCurrentPage().onCall()
    },
    onClickMap: function () {
      var e = this.data,
        l = e.latitude,
        a = e.longitude,
        u = e.addressText;
      if (a || l) {
        var n = {
          latitude: parseFloat(l),
          longitude: parseFloat(a),
          name: u,
          addressText: u,
          scale: 18
        };
        wx.openLocation(t({}, n))
      }
    }
  },
  observers: {
    content: function (t) {
      if (t) {
        var l = t.labels,
          a = l.sold_price,
          u = l.rent_price,
          n = l.address,
          i = l.brand_name,
          o = l.model_name,
          r = l.manufacture_date,
          s = l.worked_hour,
          d = l.location,
          c = (null == n ? void 0 : n.value) || "",
          p = t.class.map((function (e) {
            return e.name
          })).join(" "),
          v = (null == i ? void 0 : i.value) || "",
          h = (null == o ? void 0 : o.value) || "",
          g = (null == r ? void 0 : r.value) || "",
          m = (null == s ? void 0 : s.value) || "",
          x = ((null == d ? void 0 : d.value) || "").split(","),
          _ = e(x, 2),
          T = _[0],
          b = _[1],
          f = 0 != Number(T) && 0 != Number(b),
          k = {
            classText: p,
            addressText: c,
            brand_text: v,
            model_text: h,
            manufacture_date_text: g,
            worked_hour_text: m,
            desc: t.desc,
            callText: t.callText,
            phone: t.phone,
            user: t.user,
            title: t.title,
            is_author: t.is_author,
            getPhone: t.getPhone,
            longitude: T || "",
            latitude: b || "",
            showMap: f,
            "markers[0].latitude": b,
            "markers[0].longitude": T,
            priceTag: []
          };
        3 == t.use_type ? null != u && u.value || null != a && a.value ? (k.priceTag.push(null != u && u.value ? {
          title: "出租",
          text: "".concat(null == u ? void 0 : u.value)
        } : {
          title: "出租",
          text: "面议"
        }), k.priceTag.push(null != a && a.value ? {
          title: "出售",
          text: "".concat(null == a ? void 0 : a.value)
        } : {
          title: "出售",
          text: "面议"
        })) : k.priceTag.push({
          text: "面议"
        }) : 2 == t.use_type ? k.priceTag.push(null != a && a.value ? {
          title: "出售",
          text: "".concat(null == a ? void 0 : a.value)
        } : {
          text: "面议"
        }) : k.priceTag.push(null != u && u.value ? {
          title: "出租",
          text: "".concat(null == u ? void 0 : u.value)
        } : {
          text: "面议"
        }), this.setData(k)
      }
    }
  }
});